1. Field of the Invention
The present invention relates to a method and an apparatus for image positioning. More specifically, the present invention relates to an improvement of a method and an apparatus for positioning two images by using a template.
2. Description of the Related Art
Computed Radiography (CR) systems have been in wide use recently for obtaining radiation images over an extremely wide radiation exposure range. In a CR system, radiation image information of a subject such as a human body is recorded on a stimulable phosphor sheet which stores a portion of energy of radiation (such as X rays, xcex1 rays, xcex2 rays, xcex3 rays, electron rays, and ultraviolet rays) irradiated thereon and emits light in accordance with the stored energy upon exposure to stimulating rays such as visible light. The stimulable phosphor sheet storing the radiation image information is scanned with stimulating rays such as a laser beam to cause the sheet to emit the light which represents a signal in accordance with the image information. The light emitted is read by photoelectric reading means such as a photo-multiplier and the image signal is obtained. Based on the image signal, a radiation image of the subject is then output as a visible image on a recoding medium such as a photosensitive material or on a display apparatus such as a CRT (Japanese Unexamined Patent Publications Nos. 55(1980)-12429, 56(1981)-11395 and 56(1981)-11397, for example).
The stimulable phosphor sheets used in CR systems have various sizes depending on photographing targets, such as xc2xd cut, large, xc2xc cut, and ⅙ cut. In orthopedics, demands for photographing a long image have been high, such as for an image from neck to waist in order to measure curvature of a spine, for example. Therefore, usage of stimulable phosphor sheets having a more elongated shape than the conventional sizes has been discussed.
However, in order to deal with such elongated sheets, radiation image reading apparatuses for reading image information from the stimulable phosphor sheets need to be redesigned substantially on sheet conveyers thereof, for example. Furthermore, such radiation image reading apparatuses are disadvantageous in terms of cost, since they are dedicated to elongated sheets.
In order to solve this problem, two conventional size sheets are used serially to create an elongated shape and a radiation image is recorded on this elongated sheet. Upon reading, the two sheets are read separately. In this manner, the image can be read by a conventional radiation image reading apparatus, and the above problem does not occur.
This method enables photographing of a more elongated-shape subject by using three or more sheets. Moreover, a subject of a wide, long shape can also be recorded by using the sheets serially in two orthogonal directions. Therefore, this method has excellent flexibility depending on subjects.
In such a case where photographing is carried out by using two or more sheets, edges of two neighboring sheets are pieced together or partially overlapped. In the former method, a portion of an image is necessarily lacking at the boundary of the two neighboring sheets. On the other hand, in the latter method, such lack of image does not occur.
However, in the latter method using two sheets overlapping partially, a proper radiation image of a subject is not reconstructed even if two radiation images independently read from the two sheets are pieced together, since the two sheets have respective images of the overlapped portion.
This problem occurs not only when radiation images read from stimulable phosphor sheets are positioned but also when general images need to be positioned.
Image positioning is necessary not only in the case where images are partially overlapped as in the above case of an image formed by two or more images combined, but also in the case where subtraction processing (such as energy subtraction processing or time subtraction processing for radiation images disclosed in Japanese Unexamined Patent Publication No. 59(1984)-83486, for example) or weighted addition processing (such as superposing processing for radiation images disclosed in Japanese Unexamined Patent Publication No. 56(1981)-11399, for example) on pixels at corresponding positions of two or more images overlapping almost completely is carried out. In such cases, the above problem also occurs.
The present invention has been conceived based on the problems described above, and an object of the present invention is to provide a method and an apparatus for accurately positioning two images at least partially overlapping.
In an image positioning processing method and an image positioning processing apparatus of the present invention, a plurality of templates are set for a portion where two images overlap and ranked according to their reliability. The two images are positioned based on the templates having been ranked.
In other words, the image positioning processing method of the present invention is a method of positioning two or more images overlapping at least partially to reconstruct an image, and the method comprises the steps of:
setting, on one of two images to be positioned, at least two positioning templates in an overlap area where the one image and the other image overlap at least partially;
setting a reliability rank for each of the templates representing adequacy as a template;
determining, based on the reliability rank, a matching position where an image portion of the one image in each of the templates almost matches up with an image portion of the other image in the overlap area; and
positioning the two images based on the matching position having been determined.
xe2x80x9cOverlapping at least partiallyxe2x80x9d means not only the case where two images overlap partially but also the case where two images overlap almost completely.
xe2x80x9cTo reconstruct an imagexe2x80x9d refers to combining processing on two images overlapping partially and refers to subtraction or addition processing for two images overlapping almost completely.
The xe2x80x9creliability rank representing adequacy as a templatexe2x80x9d represents, according to a plurality of levels, adequacy as a template to be used in so-called template matching. The rank corresponds to whether or not a characteristic image portion exists within each of the templates. In other words, in the case where the image within the template is an image of uniform density distribution (such as completely black background) for example, the template generally has low adequacy as a template. In this case, the template has a low reliability rank. This is because the matching position at which a degree of matching is high cannot be specified by template matching when the image portion having uniform density distribution exists in the image to be matched by the template matching. However, for example, in a special case where an image portion of uniform density distribution exists only in an area of the same shape as the template in the other image as a target of template matching, the matching position can be specified. Therefore, the template is generally adequate and thus has a high reliability rank.
Meanwhile, templates having a characteristic portion such as an edge portion where density changes drastically have high adequacy and the rank thereof is high.
Therefore, the rank can be set simply and individually for each of the templates, based on a variance of the image portion in each of the templates, for example. In other words, a template having a characteristic portion such as an edge portion has a large variance and the reliability rank thereof is high. Meanwhile, a template not having a characteristic portion and having only a uniform density portion has a low variance. Therefore, the reliability rank thereof is set low. A template having at least one saturated pixel (a pixel whose value is a maximum, 255 in the case of 8-bit digital data) within pixels comprising the image portion in the template is preferably set to have a low reliability rank.
The rank may be set based on a result of template matching rather than on each of the templates. In other words, in template matching, while a template is being moved within the image to be matched up with, a correlation value (a degree of matching) representing similarity is found at each position therein. Therefore, the rank may be set based on whether or not a maximum of the matching degree at a specific position within a search range (an area of template movement) exceeds a predetermined threshold value. Alternatively, the rank may be set based on whether or not the position at which the matching degree becomes maximum exists only at a specific position (based on how the matching degree maximum peaks).
xe2x80x9cDetermining a matching position based on the reliability rankxe2x80x9d means to determine the matching position according to a template having a high reliability rank. This is because a matching position found by using a template having a high reliability rank is a position of high reliability, while a matching position found by using a template having a low reliability rank is a position of low reliability. For example, a template having high reliability rank is selected in advance and the matching position is determined by using only the template having been selected. Alternatively, template matching may be carried out by using all templates so that a matching position is then determined by weighting a template matching result obtained by the template having high reliability rank. Furthermore, template matching may be carried out by using all templates so that the template having high reliability rank is selected based on the template matching result. The matching position can then be determined based on the template matching result found by using the high reliability template.
In other words, in the method using the pre-selected template of high reliability rank, one or more templates having high reliability ranks are selected from the two or more templates and the matching position is determined based on the template or the templates having been selected. More specifically, for example, the matching position may be determined according to the steps of:
presetting a search range of each of the templates having been selected, within the overlap area in the other image;
finding a degree of matching at each position within the search range having been preset while independently moving, within the search range, the template corresponding to the range;
selecting, for each of the templates, a position at which the degree of matching is highest; and
determining, as the matching position, a position frequently selected out of the positions selected for each of the templates.
In the method of determining the matching position by weighting the template matching result obtained by using the high reliability rank templates having been found through template matching with all the templates, the matching position may be determined according to the steps of:
presetting a search range for each of the templates within the overlap area in the other image;
finding a degree of matching at each position within the search range having been preset for each of the templates while independently moving, within the search range, the template corresponding to the range;
selecting, for each of the templates, a position at which the degree of matching is high; and
determining, as the matching position, a position frequently selected out of the positions selected for each of the templates, by weighting selection of the positions found by using each of the templates the reliability rank of which is high.
In the method using the high reliability rank template selected based on a template matching result, the matching position may be determined according to the steps of:
presetting a search range of each of the templates within the overlap area in the other image;
finding a degree of matching at each position within the search range having been preset for each of the templates while independently moving, within the search range, the template corresponding to the search range;
setting the reliability rank for each of the templates based on a maximum matching degree or how the maximum matching degree peaks;
selecting, for each of the templates, a position at which the matching degree is high; and
determining, as the matching position, a position frequently selected out of the positions selected for each of the templates, by weighting selection of the positions found by using each of the templates the reliability rank of which is high.
In the case where the reliability rank is determined for an individual template, it is preferable to set the rank based on a variance of the image portion in the template. Meanwhile, in the case where the rank is set for each of the templates based on the result of template matching carried out by using all the templates, the rank may be set depending on an index value (such as the variance of the image) for each of the individual templates.
Prior to setting the template for positioning, rotation processing at least on one image may be carried out so that a relative tilt between the two images is corrected based on the overlap area. In this case, a load on the template matching processing can be reduced.
As the two images, two radiation images obtained by separately reading two stimulable phosphor sheets overlapping at least partially and recording a radiation image of a subject may be used. In this case, a boundary image in the an overlap portion of a first radiation image obtained by reading a first stimulable phosphor sheet placed farther from the subject upon photographing and partially overlapping with a second stimulable phosphor sheet placed closer to the subject may be detected so that the overlap area is detected based on the boundary image. In this manner, automatic detection of the overlap area can be carried out easily.
An image positioning processing apparatus of the present invention is an apparatus for carrying out the image positioning processing method of the present invention, and the apparatus positions two or more images overlapping at least partially, in order to reconstruct an image. The image positioning an processing apparatus comprises:
template setting means for setting, on one of two images to be positioned, at least two positioning templates in an overlap area where the one image and the other image overlap at least partially;
rank setting means for setting a reliability rank for each of the templates representing adequacy as a template;
matching position determining means for determining, based on the reliability rank, a matching position where an image portion of the one image in each of the templates almost matches up with an image portion of the other image in the overlap area; and
positioning means for positioning the two images based on the matching position having been determined.
The image positioning processing apparatus may comprise template selection means for selecting one or more templates having high reliability ranks from the two or more templates described above, and the matching position determining means may determine the matching position based on the template or templates having been selected. In this case, more specifically, the matching position determining means may determine the matching position in the following manner, for example. A search range for each of the templates selected by the template selection means is set in advance within the overlap area of the other image. While each of the templates is moved independently within the corresponding search range having been set, a degree of matching is found at each position within the search range. A position at which the degree of matching is highest is selected for each of the templates, and a position which is selected frequently out of the positions having been selected for each of the templates is determined as the matching position.
The matching position determining means may determine the matching position according to the steps of:
presetting the search range for each of the templates within the overlap area in the other image;
finding a matching degree at each position within the search range having been preset while independently moving, within the search range, the template corresponding to the range;
selecting, for each of the templates, a position at which the matching degree is high;
weighting selection of the position by each of the templates the reliability rank of which is high, out of the positions selected for each of the templates; and
determining, as the matching position, a position frequently selected.
In these cases, it is preferable for the rank setting means to set the reliability rank based on a variance of the image portion within the template.
Furthermore, the matching position determining means may determine the matching position according to the steps of:
presetting, within the overlap area in the other image, the search range for each of the;
finding a matching degree at each position within the search range having been preset while independently moving, within the search range, the template corresponding to the range;
selecting a position where the matching degree is high for each of the templates;
weighting selection of the position for each of the templates the reliability rank of which is high, from the positions selected for each of the templates; and
determining a position of frequent selection as the matching position, while the rank setting means may set the reliability rank of each of the templates in accordance with a maximum of the matching degree or how the maximum matching degree peaks found for each of the templates by the matching position determining means. In this case, it is preferable for the rank setting means to set the rank depending on a variance of the image portion within the template.
Prior to the setting of the templates, it is preferable for the positioning processing apparatus to further comprise rotation correction means for rotating at least one of the two images so that a relative tilt between the two images is corrected based on the overlap area.
As the two images, two radiation images obtained by separately reading two stimulable phosphor sheets at least partially overlapping and storing an image of a subject may be used. In this case, it is preferable for the positioning processing apparatus to comprise overlap area detection means for detecting the overlap area by detecting a boundary image in an overlap portion of a first radiation image obtained by reading a first stimulable phosphor sheet located farther from the subject upon photographing and partially overlapping with a second stimulable phosphor sheet located closer to the subject.
According to the image positioning processing method and apparatus of the present invention, a plurality of templates are set in an area where two images overlap, and the templates are ranked according to the reliability of the templates. Based on the templates having been ranked, the two images are positioned. Therefore, the two images can be positioned more accurately than in the case of simple template matching.